/**
 * 页面无操作，自动跳转到首页js
 */
$(document).ready(function() {
	nooperation.setDownTime();
});

$(document).bind("mousedown",function() {
	nooperation.clearDownTime();
	nooperation.setDownTime();
});

var nooperation = (function(){
	// 计时器
	var down_time = null;
	// 配置的无操作时间（单位秒）
	var goto_Time = 300;
	// 重新启动计时器
	var setDownTime = function(){
		if(goto_Time == null || goto_Time ==''){
			return false;
		}
		if(window.location.href.indexOf('gover/index.html')>0||
			window.location.href.indexOf('up')>0){
			return false;
		}
		down_time = setTimeout(function() {
			timeoutBack();
		}, parseInt(goto_Time) * 1000);
	};
	
	// 清除定时器
	var clearDownTime = function () {
		if (null != down_time) {
			clearInterval(down_time);
		}
	};
	
	return {
		setDownTime : setDownTime,
		clearDownTime : clearDownTime
	};
})();